package com.davidhigenbottam.HeatMap.shared;


public class Institution implements Result {
	/**
	 * 
	 */
	
	public static final int NUMBER_OF_ROWS= 300;
	private static final long serialVersionUID = 1L;

	String name;
	String acronym;
	double val=0d;
	boolean hasValue = false;
	
	String url;
	String geocode= null;
	boolean isPrivate= false;
	//ColourBand colourBand;
	
	public Institution(){
	}
	
	public Institution(String name){
		this(name,0f, false);
	}
	public Institution(String name, double val){
		this(name,val, true);
	}
	
	
	public Institution( String name, double val, boolean hasValue){
		this.name=name;
		this.val=val;
		this.hasValue= hasValue;
	}
	
	public Institution( String name, String acronym,String url, String geocode, String privateInst, double val){
		this.name=name;
		this.acronym=acronym;
		this.url= url;
		this.geocode= geocode;
		
		this.isPrivate= privateInst==null?true:privateInst.equals("y");
		this.val=val;
		this.hasValue= true;
	}
	
	public String getValueDescription(){
		if(hasValue){
			return String.valueOf((double)Math.round(getVal()*100d)/100);
		}
		else
			return "0";//no data
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getVal() {
		return val;
	}

	public void setVal(double val) {
		this.val = val;
		this.hasValue= true;
	}
	
	public boolean hasValue() {
		return hasValue;
	}
	public void setHasValue(boolean hasValue) {
		this.hasValue = hasValue;
	}

	public String getAcronym() {
		return acronym;
	}

	public void setAcronym(String acronym) {
		this.acronym = acronym;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getGeocode() {
		return geocode;
	}

	public void setGeocode(String geocode) {
		this.geocode = geocode;
	}

	public boolean isPrivate() {
		return isPrivate;
	}

	public void setPrivate(boolean isPrivate) {
		this.isPrivate = isPrivate;
	}

	public boolean isGeocoded() {
		return this.geocode!=null;
	}
	
	
//	public ColourBand getColourBand() {
//		return colourBand;
//	}
//	public void setColourBand(ColourBand colourBand) {
//		this.colourBand = colourBand;
//	}	
}